home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4695 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  34 lines

  1. Path: news.texas.net!usenet
  2. From: Michael Douglass <mikedoug@texas.net>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: simple code, argc, argv, strcmp()
  5. Date: Tue, 06 Feb 1996 10:02:14 -0600
  6. Organization: Texas Networking, Inc.
  7. Message-ID: <31177B86.41C67EA6@texas.net>
  8. References: <11f7cc$17261a.3b3@daprez> <9602011151.AA04526@dxmint.cern.ch>
  9. NNTP-Posting-Host: millenium.texas.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (X11; I; SunOS 4.1.4 sun4m)
  14.  
  15. Dan Pop wrote:
  16.  
  17. > So:
  18. > 1. Never use ! with strcmp.  It's a good way to shoot yourself in the foot.
  19.  
  20. Hmmm... I've *never* had any problems with do that...  Could you please
  21. clarify why it would cause you to shoot yourself in the foot?
  22.  
  23. > 2. Always check what a function is supposed to return before using it.
  24. >    strcmp returns 0 when the strings are equal.
  25.  
  26. I think he knew that, he just had hist || and && logic backwards.
  27.  
  28. -- 
  29. Michael Douglass
  30. 
  31. "I didn't change a thing and from the moment I didn't change it,
  32. it doesn't work anymore." -- Anonymous
  33.